#!/bin/bash
DT='2022-05-17'
# --学生打卡信息表 zx_ods.tbh_student_signin_record
/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://106.75.33.59:3306/teach?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username itcast_edu_stu \
--password itcast_edu_stu \
--query "select * ,'${DT}' as dt from teach.tbh_student_signin_record where 1=1 and  \$CONDITIONS" \
--hcatalog-database $1zx_ods \
--hcatalog-table tbh_student_signin_record \
-m 1
# --学生请假申请表 zx_ods.student_leave_apply
/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://106.75.33.59:3306/teach?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username itcast_edu_stu \
--password itcast_edu_stu \
--query "select * ,'${DT}' as dt from teach.student_leave_apply where 1=1 and  \$CONDITIONS" \
--hcatalog-database $1zx_ods \
--hcatalog-table student_leave_apply \
-m 1
# --班级作息时间表 zx_ods.tbh_class_time_table
/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://106.75.33.59:3306/teach?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username itcast_edu_stu \
--password itcast_edu_stu \
--query "select *,'${DT}' as dt from teach.tbh_class_time_table where 1=1 and  \$CONDITIONS" \
--hcatalog-database $1zx_ods \
--hcatalog-table tbh_class_time_table \
-m 1
# --班级排课信息表 zx_ods.course_table_upload_detail
/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://106.75.33.59:3306/teach?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username itcast_edu_stu \
--password itcast_edu_stu \
--query "select *,'${DT}' as dt from teach.course_table_upload_detail where 1=1 and  \$CONDITIONS" \
--hcatalog-database $1zx_ods \
--hcatalog-table course_table_upload_detail \
-m 1
# --在读学员人数信息表 zx_ods.class_studying_student_count
/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://106.75.33.59:3306/teach?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username itcast_edu_stu \
--password itcast_edu_stu \
--query "select *,'${DT}' as dt from teach.class_studying_student_count where 1=1 and  \$CONDITIONS" \
--hcatalog-database $1zx_ods \
--hcatalog-table class_studying_student_count \
-m 1